﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ElementumForever.Interfaces;

namespace ElementumForever.CommandPattern
{
    class ChangeRotationCommand : ICommand
    {
        IEntityProperty entity;
        float oldR, newR;

        public ChangeRotationCommand(IEntityProperty entity,float oldR,float newR) {
            this.entity = entity;
            this.oldR = oldR;
            this.newR = newR;
        }

        public void Execute(IsceneBuilder modeler)
        {
            entity.Rotation = newR;
        }

        public void UnExecute(IsceneBuilder modeler)
        {
            entity.Rotation= oldR;
        }
    }
}
